import { Injectable } from '@angular/core';
import { StateMachineService } from "@farris/command-services";
import { FrameContext} from '@farris/devkit';
import { FormNotifyService,FormLoadingService } from '@farris/command-services';

@Injectable()
export class GzbfsqformFrmControllerService {
  constructor(
  private frameContext: FrameContext,
  public stateMachineService: StateMachineService,
  public formNotifyService: FormNotifyService,
  public loadingService: FormLoadingService
  ) {}

  /**
   * 插入数据
   * @remarks 
   * @returns 
   */
  insertData(): any {
    const uiState = this.frameContext.uiState;
    const selectData =uiState['selectData'];
    console.log('selectData:', selectData);
      const context = this.frameContext;
      const bindingData = context.bindingData;
    selectData.forEach((item) => {
      bindingData.setValue(['bfsqmxs','gztzid','gztzid'],item.id,true,true);
      debugger
      bindingData.setValue(['bfsqmxs','gztzid','gztzid_gzwybh'],item.gzwybh,true,true);
      bindingData.setValue(['bfsqmxs','gztzid','gztzid_gys'],item.gys,true,true);
      bindingData.setValue(['bfsqmxs','gztzid','gztzid_gzid_gzbzbm'],item.gzid.gzid_gzbzbm,true,true);
      bindingData.setValue(['bfsqmxs','gztzid','gztzid_gzid_gzbzmc'],item.gzid.gzid_gzbzmc,true,true);
      bindingData.setValue(['bfsqmxs','gztzid','gztzid_gzid_ggxh'],item.gzid.gzid_ggxh,true,true);
      bindingData.setValue(['bfsqmxs','gztzid','gztzid_gzid_xh'],item.gzid.gzid_xh,true,true);
      bindingData.setValue(['bfsqmxs','gztzid','gztzid_gzid_dw'],item.gzid.gzid_dw,true,true);
      bindingData.setValue(['bfsqmxs','gztzid','gztzid_gzid_cc'],item.gzid.gzid_cc,true,true);
    });
    
  }
}
